home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Everything For A Hacker
/
19990506-[HACK].iso
/
HEXEDIT
/
CROSSASM
/
EPASM13.ARJ
/
EPASM.DOC
next >
Wrap
Text File
|
1992-03-10
|
51KB
|
1,518 lines
E P A S M
Microprocessor assembler
for the Intel 8749H
Joseph L. Hora
January 12, 1992
Version 1.3
EPASM Assembler October 11, 1990
Table of Contents
I. Introduction . . . . . . . . . . . . . . . . . . . . . . 2
II. Loading EPASM on your system . . . . . . . . . . . . . . 4
III. Creating an assembly language program . . . . . . . . . 6
IV. EPASM assembler directives . . . . . . . . . . . . . . . 8
Description of assembler directives . . . . . . . . . . 8
; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
ORG . . . . . . . . . . . . . . . . . . . . . . . . 8
"label" . . . . . . . . . . . . . . . . . . . . . 8
CONST . . . . . . . . . . . . . . . . . . . . . . 9
INCLUDE . . . . . . . . . . . . . . . . . . . . 10
V. MCS-48 command notes . . . . . . . . . . . . . . . . . 12
VI. Assembling your program . . . . . . . . . . . . . . . . 15
command line options . . . . . . . . . . . . . . . . . 15
Running EPASM . . . . . . . . . . . . . . . . . . . . 16
VII. Error messages . . . . . . . . . . . . . . . . . . . 18
VII.1 Command, file, and DOS errors . . . . . . . . . 18
VII.2 EPASM assembly errors . . . . . . . . . . . . . 19
VIII. Using the EPROM programming device . . . . . . . . . 22
INVOICE . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1
EPASM Assembler October 11, 1990
I. Introduction
The EPASM program is a one-pass assembler that was written for
the Intel 8749H EPROM as described in the Intel Microcontroller
Handbook, using the MCS-48 instruction set. This assembler can
also be used for other chips using this instruction set (8748H
EPROM, 8048AH/8049AH/8050AH ROM, and 8035AHL/8039AHL/8040AHL CPU)
as far as their memory structures are similar to the 8749H EPROM.
This manual is not intended to be a reference for the MCS-48
instruction set or the above mentioned devices. Please refer to
the Intel Microcontroller handbook for a complete description.
The input to the EPASM program is a file containing "source code"
which is the EPROM program. This contains the MCS-48 command
mnemonics, labels, assembler directives, and comments. EPASM
converts it into the machine code of the processor, the actual
command numbers that will direct the processor to carry out the
steps the programmer has specified. This machine code is saved
to a file which then must be transferred to the processor using a
EPROM "burner" or programming device.
The output of EPASM is an object code module file. In this file
are the encoded commands that were specified by the assembler
language program. This program was written to construct an
ASCII file suitable for the PROMPRO 7 EPROM Programming Unit,
made by Logical Devices, Inc. The files have also been used to
program EPROMs using the B&C Microsystems 1409 Universal (E)EPROM
programmer. However, the file can also be passed to many other
EPROM programming devices that support the same format. The file
could also be converted by a program of your own to the proper
format for your device.
This program is distributed as shareware. It may be freely
distributed to others, as long as it is in the form of the
archived .ZIP file which contains all the separate files
necessary for EPASM, and the files are not modified in any way.
If you find this program useful, register your use of the program
by sending $15 to
Joseph Hora
46-1063 Emepela Way, Unit D
Kaneohe, HI 96744-3975
When registering, you will receive the latest version of EPASM
(without the annoying registration screen), a printed copy of the
manual, and the source code for EPASM (written in Turbo Pascal
2
EPASM Assembler October 11, 1990
5.0). You will also be notified when updates of the program
occur in the future. Questions and technical support can be
obtained by mail at the above address, or by phone at (808) 956-
9848 weekdays 8am-5pm HST.
Your registration entitles you to use this software on a single
computer and to make as many copies of this software as you wish
for backup purposes.
Note: MCS-48 and the various chip names mentioned above and
throughout this manual are registered trademarks of the Intel
Corporation. The EPASM program and associated files are
copyright 1990-92 by Joseph Hora.
3
EPASM Assembler October 11, 1990
II. Loading EPASM on your system
Before doing anything else with your distribution disk, make a
backup copy first.
The approved EPASM release is archived using the PKZIP file
archiving utilities, and is named "EPASM.ZIP" . This includes
the following files:
EPASM.EXE - the assembler program
EPASM.DOC - this document
INSTR.SET - the MCS-48 instruction set
SAMPLE.ASM - a sample assembly language program
INVOICE.DOC - the registration form for EPASM
To install the assembler, these files must be extracted and
placed in a directory of your choice. The following are
instructions for various system options.
Single floppy drive systems:
First, make a backup of the distribution disk. Place the
original EPASM (source) disk in drive A: and type
diskcopy a: a:
Wait until the computer is done reading the disk and asks you for
the target disk. Remove the original disk and place a blank disk
in drive A:, then type <RETURN>.
If you have PKUNZIP and EPASM.ZIP on the same 360K or larger
floppy disk with nothing else, there will be enough room to store
all the original plus extracted files. At the DOS prompt, type
pkunzip epasm
and the files will be extracted to the default directory.
Dual Floppy users:
First, make a backup of the distribution disk. Place the
original EPASM (source) disk in drive A: and a blank formatted
disk (target) in drive B: and type
diskcopy a: b:
4
EPASM Assembler October 11, 1990
Wait until the computer is done reading the disk and writing to
the target disk.
You can make an EPASM disk by doing the following: First, make
sure you have PKUNZIP and EPASM on one disk, and place it in the
A: drive. Place a blank formatted disk in the B: drive and type
"B:" to change default to that drive. Then type
a:pkunzip a:epasm
and the files will be extracted and written to the disk in the B:
drive.
Hard disk users:
See the above instructions to backup your copy of EPASM before
you install the program on your hard drive.
Place the disk with the files EPASM.ZIP and PKUNZIP in the A:
drive. Make a subdirectory on your hard drive to place your
EPASM files into, for example, type
C:\>mkdir epasm
(Type the commands above that are after the >). Change directory
to that subdirectory
C:\>cd epasm
C:\EPASM>
Then type
C:\EPASM>a:pkunzip a:epasm
and the files will be extracted and written to the directory you
are currently in on the hard drive.
5
EPASM Assembler October 11, 1990
III. Creating an assembly language program
You must create the source code for EPASM in a text editor
program. This can be any program that allows you to save the
file in "ASCII" or "DOS" format. This means just text, with no
page breaks, printer commands, formatting codes or commands
specific to the word processing program. For example, in
WordPerfect, you can use the Ctrl-F5,1,1 command to save the
document as a DOS text file.
EPASM will create various output files, based on the text file
containing commands it is given and the command line options (see
Chapter VI.) These output files can be viewed using the "TYPE"
command from the DOS command prompt. The files can also be read
into the word processing program and viewed in the same way the
source code can. This is most useful when the user is trying to
track down errors in the source code.
There are two element types in the program, assembler directives
and MCS-48 commands. Assembler directives are commands that are
processed during the assembly by the EPASM assembler. The second
type are commands that are converted directly into machine code
for the EPROM processor. These two types are discussed in the
following chapters.
Below is a short excerpt from a sample program written for this
assembler:
;
;
; IDLE routine: remain here until interrupted
;
IDLE mov R3,#80 ;select expander 0, disable chop
mov a,#8F ;address " "
outl P2,a ; " " "
movd P7,a ;output slave idle state
call riff ;reset interrupt-in-progress
jmp IDLE ;jump to IDLE
;
; End of IDLE routine
;
This short excerpt illustrates a number of characteristics of the
source code. First, the simplest command is the semicolon
character ";", the comment command. This simply instructs the
assembler to ignore all the characters following that one on the
6
EPASM Assembler October 11, 1990
current line. It can be used at the beginning of the line to
designate the entire line as a comment, or it can be at the end
of a valid command. In the above example, it is used to space
out the routine with blank lines, hold the title of the routine,
and annotate each command line with a comment. This is usually a
good practice, since even a small assembly language program is
difficult to follow without a few comments explaining the code,
even for the person who wrote the program!
Note that there is a mix of uppercase and lower case characters
in this example. EPASM treats upper and lower case letters to be
equal. Therefore, the commands "mov" and "MOV" are treated in
exactly the same way.
The next assembler directive used is in the first non-comment
line, the text "IDLE". This is being used as a "label", or a
marker designating that line or address in the program. This
allows the programmer to reference commands in the program
without knowing the actual address of the command in the program
memory. Notice at the end of the routine there is a "jmp IDLE"
command, which will cause the EPROM to loop back to the beginning
of the routine when it runs the program. The EPASM program
determines the address of "IDLE" as it assembles the program.
On the same line as the "IDLE" label is the MCS-48 command for
the processor. Note that these words are all separated by a
number of spaces. Any combinations of spaces and tabs may be
used to separate the words of each line. The spacing can be
chosen arbitrarily to make the program easy to read. In the
above example, the first column is reserved for labels. This
makes the labels easy to see and therefore easier to follow the
flow of the program. The next two columns hold the command
arguments, and the third column holds a comment for that line.
This is a fairly standard format for assembly language programs.
Another equally valid format would be to have the commands be in
one column, as in the following:
;
;
; IDLE routine: remain here until interrupted
;
IDLE mov R3,#80 ;select expander 0, disable chop
mov a,#8F ;address " "
outl P2,a ; " " "
movd P7,a ;output slave idle state
call riff ;reset interrupt-in-progress
jmp IDLE ;jump to IDLE
;
; End of IDLE routine
;
7
EPASM Assembler October 11, 1990
IV. EPASM assembler directives
This chapter describes the valid assembler directives for the
EPASM program. An assembler directive is a command that does not
directly generate machine code in the output file, but affects
the way EPASM compiles the program. The following are the
recognized assembler directives, and a description of each:
; ORG "label" CONST INCLUDE
Description of assembler directives:
;
the comment character. Directs EPASM to ignore all other
characters following this one on the same line.
ORG
specifies the location of the start of the program in the
processor's program memory. The default location if this
directive is not used is zero. The correct syntax is
ORG addr
where "addr" is the desired starting address, in
hexadecimal.
"label"
any word more that three characters long and less than nine
characters which is intended to mark a location in memory.
I have enclosed the word "label" in quotes, since there is
no actual command that you invoke by typing "label", you
simply use a word that is not a command and the assembler
will interpret it as a label. The label cannot be the same
as another of the assembler directives (such as ORG or
CONST), or be the same as one of the MCS-48 commands (such
as MOV or JMP). Note that since no upper and lower case
distinctions are made, the label "IDLE" is treated the same
as the label "idle".
When the label appears as the first element of a line, that
equates the label with the memory position of that line.
8
EPASM Assembler October 11, 1990
When the label appears in any other line after a valid MCS-
48 command, that means that label is being referenced. When
the EPROM program is assembled, the address corresponding to
the line where the label appears will be placed in that
command. The label can be defined only once, but referenced
many times. Below is a program excerpt where labels are
used. The routine checks the test pins of the 8749H
processor and takes actions based on their state. Notice
the use of labels: the first label is "Main" which is
referenced in a number of instructions. Other labels allow
control of the program flow based on the conditions
encountered.
Example IV.1
Main JT0 Stat1 ;If T0 set, goto Stat1
JT1 Stat2 ;If not T0 and T1, go here
Mov R1,#20 ;Neither T0 or T1, BankA<<<<
Jmp StatEnd ;Exit Stat section
Stat1 JNT1 Stat3 ;
Mov R1,#00 ;If T1 also set, then WAIT
Jmp Main
Stat3 Mov R1,#40 ;T0 and not T1, so Bank B<<<<
Jmp StatEnd ;
Stat2 Mov R1,#60 ;not T0 and T1, so Bank C<<<<
StatEnd Mov A,R1 ;Get current base address
XRL A,R2 ;Compare to last base address
JZ TakDat ;If same, go inc. counters
MOV A,R1 ;Different bank this time
MOV R2,A ;set "old" base address here
IN A,P1 ;set old port reading equal
MOV R3,A ; to current one
IN A,P2 ;same for port 2
MOV R4,A
JMP Main ;End of Main Program loop
The processor running this program would repeat the loop,
testing T1 and T2. If the current base address as the last
time, the program jumps to the line designated by the
"StatEnd".
CONST
This assembler directive is useful for equating hex
constants with words. It is exactly like defining a label
that references a constant, not a memory location. The
syntax of the directive is
CONST name value
9
EPASM Assembler October 11, 1990
For example, the program in example IV.1 above considers the
memory as being divided up into 3 "banks": A, B, and C, at
locations 20, 40, and 60 (hex). Instead of the statements
above which explicitly specify these memory locations, one
could define constants to make this more readable. If the
following lines are included in the program file:
;
; Constants
CONST BankA 20 ;Bank A: 32-63 decimal
CONST BankB 40 ;Bank B: 64-95 decimal
CONST BankC 60 ;Bank C: 96-127 decimal
;
Then example IV.1 could be written as follows:
Example IV.2
Main JT0 Stat1 ;If T0 set, goto Stat1
JT1 Stat2 ;If not T0 and T1, go here
Mov R1,#BankA ;Neither T0 or T1, so Bank A<<<<
Jmp StatEnd ;Exit Stat section
Stat1 JNT1 Stat3 ;
Mov R1,#00 ;If T1 also set, then WAIT
Jmp Main
Stat3 Mov R1,#BankB ;T0 and not T1, so Bank B<<<<
Jmp StatEnd ;
Stat2 Mov R1,#BankC ;not T0 and T1, so Bank C<<<<
StatEnd Mov A,R1 ;Get current base address
XRL A,R2 ;Compare to last base address
JZ TakDat ;If same, go increment counters
MOV A,R1 ;Different bank this time, reset
MOV R2,A ;set "old" base address here
IN A,P1 ;set old port reading equal
MOV R3,A ; to current one
IN A,P2 ;same for port 2
MOV R4,A
JMP Main ;End of Main Program loop
The main reason for having the CONST directive is for
program clarity. It is much easier to understand what you
are doing if you write data to "BankC" instead of "80".
INCLUDE
This directive causes EPASM to stop reading from the current
file being assembled, open the file specified and assemble
commands from that file into the program until the end of
that file is reached, then return to the original program
10
EPASM Assembler October 11, 1990
and continue assembling. It is effectively the same as
having those commands in the INCLUDE file in your program.
The command syntax is
INCLUDE [path]filename
The file must be in the current directory, or the full path
specified, or else EPASM will not be able to find the file
and an error will be generated. This command is useful if
you have a number of standard definitions or routines that
you use in many programs. Then you can have a single file
containing them and all the other programs you write can
INCLUDE this file, so you don't have to have multiple copies
of the routines in every file. Also, when editing the
standard routines, you can then recompile the routines and
the changes will be effective in all programs that use that
file.
The only limitation on the include file is that you cannot
"nest" the include files. That is, you cannot have an
"INCLUDE" file that has another "INCLUDE" command for yet
another file.
Also, when there is an error in the program after the
include file, the line number reported will be the actual
line number of the program file plus the number of lines in
the include file. If the error is in the include file
itself, the line number reported will be the line number of
the error in the include file plus the number of lines ahead
of it in the main program. To be certain of the line
numbers, the best way is to look at the .WRK file created by
EPASM (see chapter VI). This file will show all lines from
the main program and the include file together, in the order
assembled.
11
EPASM Assembler October 11, 1990
V. MCS-48 command notes
The MCS-48 commands are stored in the file INSTR.SET. This
should, for the purposes of EPASM, be the reference for the
correct syntax of the commands, since they will be expected to be
exactly as they are spelled in this file. Note that all the
commands in the file INSTR.SET must be in upper case, since any
file assembled will be converted to upper case before being
compared to these commands. The commands in the program to be
assembled can be in either upper or lower case, as discussed
above.
The file INSTR.SET is an ASCII file, with each line being the
definition for one command. Comments can also be included, if
they are preceded by a semicolon. Below are a few sample lines.
;
;
JF0 $ B6 2
JF1 $ 76 2
JMP ! 04 2
MOV A,# 23 2 ;this command moves in the immediate word
MOV A,PSW C7 1
MOV A,R0 F8 1
MOV A,@R0 F0 1
MOV A,@R1 F1 1
MOV A,T 42 1
The format of the line is first the command word(s), then an
address or data indicator, if any, then the hex machine code for
the command, then the number of machine cycles for that command.
The data or address indicators are the "#" and the "$"
characters, respectively, and they show that the command includes
a byte of data or an address. For example, the command to move
immediate data to the accumulator is given by the line
MOV A,# 23 2
Since it contains the "#" character, it indicates that a second
byte is required; namely, the data to be moved into the
accumulator. So the correct usage of this command would be
MOV A,#1C ;Move the value 28 (1C hexadecimal) to acc.
Similarly, the "$" character indicates that an address is needed
in the command. So in the command
JF1 $ 76 2
12
EPASM Assembler October 11, 1990
the program will jump to the address given if flag 1 is set. The
correct usage of this command is
JF1 DONE ;if flag set, jump to DONE
where DONE is a label that is defined elsewhere in the program.
Note that when the address is given by an eight-bit value, the
location of DONE must be on the same memory page as the JF1
command, or else the jump will not be performed properly.
The "!" character is used for the JMP and the CALL commands,
which have a 11-bit address (in order to cover the entire 2K
address space). The upper three bits of the address are encoded
into the first byte of the command. This differs from the
address byte in commands using the "$" character, which is just
the second byte and therefore is limited to eight bits. EPASM
treats these two commands specially and encodes the address
automatically.
Other commands have no data or address information, and are
completely specified in the INSTR.SET file. For example,
MOV A,@R1 F1 1
specifies the command to move data memory contents into the
accumulator (register R1 has been previously loaded with the
desired address). The correct usage of this command is
MOV A,@R1 ;Move register-addressed data into acc.
almost precisely as it appears in INSTR.SET.
Because the INSTR.SET file is in ASCII format and read into the
EPASM program every time it is executed, the INSTR.SET file can
be edited to change the syntax of the commands, if desired. This
is not usually recommended, since it is good to keep the command
names similar to the MCS-48 commands for clarity. However, if
you wish to program for a different EPROM with a different
command set, one could simply change the file INSTR.SET to
contain the commands in the alternate instruction set. The only
restriction is that the CALL and JMP commands cannot be changed,
since they are handled in a special way. Also, new commands with
the "!" character cannot be added, since it requires changes in
the EPASM program. Of course, if you have registered your copy
of EPASM and have the source code, you can alter the assembler
program for different devices.
Another feature of EPASM is the ability to do simple arithmetic
within the statement with hexadecimal numbers. The allowed
operations are addition and subtraction. For example, say that
you wanted to move the value 8C into the accumulator. The
command would be
13
EPASM Assembler October 11, 1990
MOV A,#8C ; fill accumulator with value
Now say that you wanted to move a number that was 7 larger than
8C. The correct command would be
MOV A,#8C+07 ;fill accumulator with 7 greater than 8C
This expression is evaluated during the assembly, and the correct
constant value (147, or 93 hexadecimal) is placed in that memory
location. So the command is equivalent to
MOV A,#93 ;fill accumulator with 93 hex
Since the expression is evaluated before the .OBJ output file is
written, the statement will not add to the object code file
length, or slow the program down. This feature is useful when
you don't feel like doing the math operaation, or when you want
to show the relationship between constants.
14
EPASM Assembler October 11, 1990
VI. Assembling your program
Once the program has been written and saved to disk as an ASCII
or "DOS" format text file, it is ready to be assembled by EPASM.
The following is the command syntax for the assembler:
epasm progname [-w -e -b -l -h] [filename]
The "progname" above should be the file name of the ASCII file
which contains the assembly language program you wish to
assemble. It can be just the file name, or the full path if the
file is not in the default directory. The extension ".ASM" is
assumed if none is used. Be sure not to use the extension .TMP,
because EPASM uses this for a temporary file, and later erases
it. If you have another file with the same root name as your
program and this extension, it will be erased.
The command line options are:
-w : create a "work" file, showing the program memory
address, the assembled commands, and the original
command from the input file source code. This is
extremely useful when debugging the program, to see
where the error is occurring and what the EPASM program
is trying to do with the commands it is given. The
default file name is the original name, with the
extension ".WRK".
-e : create an error listing file. This is a file
containing all the error messages generated when
running EPASM. These messages are also printed to the
screen, but may come too fast to see them all. The
default file name is the original file name with the
extension ".ERR".
-b : in addition to the ASCII object module created whenever
EPASM successfully assembles a file, a binary file
containing the machine code can also be created using
this option. The binary file is a non-printable file
which is 2K bytes in length and contains no format
characters, checksums, etc, just the machine code in
binary format. This file may be useful when a EPROM
programming device may require a different format than
the default .OBJ module normally created by EPASM.
This binary file can be read easily into a conversion
program that the user would write to output the proper
format. The default name for this file is the original
name and the extension ".BIN".
15
EPASM Assembler October 11, 1990
-l : this option creates a label listing output file that
may also be useful for debugging purposes. This file
contains a list of the program addresses and the
machine code to be placed in that address. Labels are
indicated by a carat (^) followed by an ASCII character
for identification. At the end of the program will be
a listing of all the labels used and the characters
used to identify them in the listing above it. This
output was mainly used during the development of EPASM,
but it can also be useful as a debugging tool. The
default name for this file is the original file name
plus the extension ".LAB".
-h : This option creates a "Hex" output file, which is an
ASCII file with the assembled commands listed in
hexadecimal form, 16 bytes per line (32 characters).
This is basically the .OBJ format without the header
information and the checksum. See chapter VIII.
Note that when using command line switches, either upper case or
lower case can be used, so that "-E" is the same as "-e". Also,
the DOS switch character can be used (e.g., "/E").
Running EPASM
When EPASM is run without any arguments, the program simply lists
the command format and gives a short reminder of the command line
options. To do this, just type
C> EPASM
(Note: in this example and those below, the "C>" represents the
DOS prompt and should not be typed.) The EPASM program must be
in the default directory, or a directory that is accessible via
the current DOS PATH defined. The file INSTR.SET must be in the
default directory or the same directory as EPASM, otherwise the
error "Instruction set not found" will be generated. To assemble
a program, type EPASM plus the file name to assemble. For
example, if you wish to assemble the file SAMPLE.ASM which is
included with this documentation, type
C> EPASM SAMPLE
The extension ".ASM" is assumed, and need not be entered. If you
wish to assemble a file called SAMPLE.TST, just type
C> EPASM SAMPLE.TST
If you use command line switches, separate them with spaces from
the rest of the command and from each other. For example, if you
want to create a "work" file and an error listing (if there are
16
EPASM Assembler October 11, 1990
any errors in the program), type
C> EPASM SAMPLE -E -W
If there are errors, the files SAMPLE.ERR and SAMPLE.WRK will be
created. If there are no errors, the files SAMPLE.WRK and
SAMPLE.OBJ will be created. If you wish to specify different
file names for the output files, the names can be included after
the switch. For example, if we want to assemble the file
SAMPLE.ASM, but want the work file name to be WORK.SMP, and
create in addition to SAMPLE.OBJ a binary output file, we would
type
C> EPASM SAMPLE -W WORK.SMP -B
While the EPASM program is running, it will notify you of errors
it encounters by printing a message to the screen. If errors are
encountered, no .OBJ, .HEX or .BIN output files are generated.
If no errors are encountered, an .OBJ file will be created, along
with a .BIN or .HEX file if the proper command line switch is
used. An .ERR file will not be created, even if one is specified
using the command line switch.
If you wish to stop the assembly at any time, just press any key.
The program will suspend the assembly and ask if you wish to
abort. Type "Y" if you want to stop. This feature means that
you can't "type ahead" the next DOS commands after EPASM, but the
ability to terminate the assembly is very useful, mostly when
EPASM finds errors and you do not want the assembler to bother
with the rest of the file until you have gone back and corrected
the errors.
The file SAMPLE.ASM is included with this release to mainly
illustrate the proper syntax and structure of an .ASM program,
not to show good or useful programming technique.
17
EPASM Assembler October 11, 1990
VII. Error messages
The first section below summarizes some of the errors that may
occur in the command used to start EPASM from DOS, and errors in
finding the proper files necessary to run EPASM. The second
section describes the error messages given by EPASM when it finds
errors in the program it is assembling. Tips are given as to
what to do to correct the errors.
VII.1 Command, file, and DOS errors
Bad command or file name
Make sure that you typed EPASM correctly, and that the
EPASM.EXE program is in the current directory, or accessible
via the PATH you have currently defined.
Instruction set file INSTR.SET not found
The file INSTR.SET is not in the default directory or cannot
be found in the directories defined in the current DOS PATH.
Make sure you have copied it from the distribution disk to
the proper directory.
Error in command line parameter
You used an invalid combinations of switches and file names
in the command line when you ran EPASM. See chapter VI for
instructions on using the command line switches and file
names.
File not found
Path not found
The file name you specified is not correct, or it is not in
the directory you specified, or that directory does not
exist. Check the file names used in the command line, and
in the INCLUDE files used, if any.
Disk is write-protected
If your files are on a floppy drive, make sure the write
18
EPASM Assembler October 11, 1990
protect tab is not on (for a 5 1/4" disk) or in the proper
position (covering the hole in the 3.5" disk).
Drive not ready
Make sure the disk is in the drive specified, and the disk
is locked in for reading.
VII.2 EPASM assembly errors
The following are error messages generated by EPASM when it finds
errors in the program it is assembling. The error message will
be printed out, followed by some of the offending text, and a
line number. Often if a line has an error in it, two different
error messages will be created, as EPASM tries to interpret the
code in different ways. When the problem is solved, both
messages will go away.
The error detection in EPASM can only detect certain errors. It
cannot, of course, diagnose logical errors that will cause your
program to not work as you expect after you have "burned" the
program into your EPROM.
Invalid constant character
The text encountered is being interpreted as a hexadecimal
constant, and there was an error in converting the number.
You may be trying to define a label that is two or fewer
characters in length (a label must be three to eight
characters long), or you mistyped the constant (you entered
8L when you intended 8C).
Hex constant overflow
The assembler is expecting a hexadecimal constant in that
location, but the number there is over two digits in length
(constant limits are 00 to FF hexadecimal).
Invalid jump command
The jump command entered is not a valid MCS-48 jump command.
19
EPASM Assembler October 11, 1990
Syntax error
The command used on the line is not a valid MCS-48 command.
Most likely you have misspelled the command, or the
assembler is attempting to evaluate a label as a command.
Make sure there are spaces or tabs separating the elements
in a line.
Call instruction cannot be located at [address]
The CALL instruction cannot be located at addresses 2046-
2047 or at 4094-4095. You must change your program so that
these statements do not fall on these addresses.
Conditional jump at [address] cannot reach destination
The conditional jump commands (e.g., JC, JF0, etc.) can only
jump to addresses on the same 256-byte memory page, since
the address used in the command is only 8 bits. The program
is trying to jump to a label (address) on another page. You
must change the program so that either the conditional jump
and the destination are on the same page, or rewrite the
code so that you jump across the page boundary (the CALL and
JMP commands are not restricted to one page, they can jump
directly to any location within the 2K program memory).
Unresolved label
You have referenced a label somewhere, but never defined its
location (you define a label by putting it as the first
element in some line). Either you forgot to define it, or
misspelled it, either here or where it was defined.
Warning: cannot nest INCLUDE files
Your INCLUDE file contains another INCLUDE file. This is
not allowed: call the second INCLUDE file from the main
program. The second INCLUDE file will be ignored, and the
assembly will continue.
Warning: error opening INCLUDE file
The INCLUDE file you specified could not be found. The
INCLUDE file must be in the default directory, or must be
specified by the full path name. The assembly will continue,
but without the information in the INCLUDE file. Check the
location of the file.
20
EPASM Assembler October 11, 1990
Work file error
There was an error opening or deleting the work file
specified (or the default work file name, if none explicitly
chosen). EPASM first creates a work file with the extension
.TMP, then at the end, erases this and makes a work file
with the extension .WRK, or whatever you have specified. Be
sure not to have any other files in the directory with the
extension .TMP, or they may be erased!
21
EPASM Assembler October 11, 1990
VIII. Using the EPROM programming device
The procedure that you use to program or "burn" the EPROM will
vary greatly, depending on the device being used. In most cases
you will be able to send the programming device a file of
commands, which will direct the device to program the EPROM.
This file is one of the output files from the EPASM program which
contains your assembled code, either the default .OBJ file (which
is the most common case), or the hex or binary files containing
the same program in different format.
Some programming devices (such as the PROMPRO-7) require that
you communicate with it using a terminal emulator program. In
this case, the emulator program has to have an "upload" command
to send a file to the device.
Other devices come with their own software drivers, such as the
B&C Microsystems 1409 Universal programmer. With this device,
the file can be read in and sent directly using commands from the
driver program.
There are three output file options in the EPASM program. The
default .OBJ files are in Intel hex format. Each line of the
file has the following information (all numbers in hexadecimal):
INTEL hex format
# of ASCII
Characters Description
1 the colon character (:)
2 number of data bytes N in record (00 for end record)
4 the starting address of where the data bytes are to
be located
2 00=program data in line, 01=end of file record
N*2 the program data to be loaded into the EPROM
2 checksum (two's compliment of the sum of the bytes
after the colon character, modulo 256)
EPASM always sets N above equal to 10H (16 decimal).
Another format option is the binary file, which contains the
program to be loaded into the EPROM with no formatting
information, just the bytes starting at address 0 and going to
the end of the program memory, for a total of 2048 8-bit bytes of
data. The locations from the end of the assembled program to the
22
EPASM Assembler October 11, 1990
end of the program memory space will be filled with zeros.
A final format is the ASCII hex file, which contains the ASCII
representation of the hex data to be loaded into the EPROM. This
is just the same as the Intel file, except only the program data
is in the file, there is no header information or end record.
The data for program starting at address 0 going to the end of
the program are included in the file. Sixteen program memory
values are written per line (32 ASCII hex digits).
23
EPASM Assembler October 11, 1990
INVOICE
Remit to:
Joseph Hora
46-1063 Emepela Way, Unit D
Kaneohe, HI 96744-3975
Questions and technical support number:
(808) 956-9848
internet: hora@galileo.ifa.hawaii.edu
From:
________________________________________________
________________________________________________
________________________________________________
________________________________________________
Enclosed is $15.00 ( Check ___ Money Order ___ P. Order ___)
for registration of EPASM. Please send me the latest version of
the EPASM program and example files, a printed version of the
manual, and the source code for the EPASM program (in Turbo
Pascal 5.0), and put me on the mailing list for future updates
and extensions to the EPASM program.
24